//
//  ChanageNationViewCtrler.m
//  MIDI
//
//  Created by 千行时线 on 15/9/16.
//  Copyright (c) 2015年 QXSX. All rights reserved.
//

#import "ChanageNationViewCtrler.h"
#import "AppConfig.h"
@interface ChanageNationViewCtrler ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *mainUITabelView;
@property (strong,nonatomic) NSMutableArray * suoyinCityList;
@end

@implementation ChanageNationViewCtrler

- (void)viewDidLoad {
    [super viewDidLoad];
    self.mainUITabelView.sectionIndexColor = UIColorRGBA(19, 208, 202, 1);
    for(char c ='A';c<='Z';c++)
        
    {
        
        //当前字母
        
        NSString *zimu=[NSString stringWithFormat:@"%c",c];
        
        if (![zimu
              isEqualToString:@"I"]&&![zimu
                                       isEqualToString:@"O"]&&![zimu
                                                                isEqualToString:@"U"]&&![zimu isEqualToString:@"V"])
             
        {
            
            [self.suoyinCityList addObject:[NSString stringWithFormat:@"%c",c]];
            
        }
        
    }
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self configNavigationItem];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView

{
    return self.suoyinCityList;
    
}

//索引列点击事件

-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index

{
    //点击索引，列表跳转到对应索引的行
    
    [tableView
     scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:index+4]
     atScrollPosition:UITableViewScrollPositionTop animated:YES];
    
    return index+4;
    
}

-(void) configNavigationItem
{
    [self.tabBarController configNavigationBarTintColor:UIColorRGBA(0, 0, 0, 1)];
    [self.navigationController.navigationBar setBarTintColor:MIDIColorOfNavigationBar];
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
    self.navigationItem.title = @"国籍";
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITextAttributeTextColor, [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0],UITextAttributeTextShadowColor,[UIFont fontWithName:@"Hiragino Sans GB" size:18.0],UITextAttributeFont,nil]];
    
    [self configNavigationBackAction:^{
        
        [self.navigationController popViewControllerAnimated:YES];
    }];
    
}



#pragma mark tableView datasource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 0;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 32;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return nil;
}

#pragma mark - Table View Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}
@end
